/**
  * Created by admin on 17/3/14.
  */
object AV {
  def dd(): Unit ={
    println("asdf");
  }

  def main(args: Array[String]): Unit = {
    var counter = new Counter();
    counter.increment();
    println(counter.value);
  }

}

class Counter {
  var value = 0 // 必须初始化字段
  def increment() { value += 1 } // 方法默认公有
  def current = value // 调用必须是myCounter.current这种风格
  //def getVal():Integer={return value}
}